package com.g1.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.g1.entity.Student;
import com.g1.mapper.StudentMapper;
import com.g1.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;
    @Override
    public List<Student> selectAll() {
        return studentMapper.selectList(null);
    }

    @Override
    public Student selectById(Long id) {
        return studentMapper.selectById(id);
    }

    @Override
    public int update(Student stu) {
        return studentMapper.updateById(stu);
    }

    @Override
    public int delete(Long id) {
        return studentMapper.deleteById(id);
    }

    @Override
    public int insert(Student student) {
        return studentMapper.insert(student);
    }
}
